package com.xltx.weibo.service;

import com.xltx.weibo.model.SocialUser;
import com.xltx.weibo.model.SinaUserInfo;
import org.springframework.lang.NonNull;

/**
 * @author liuyc
 * @ClassName WeiboService
 * @Description
 * @Date 2021/12/21 17:00
 */
public interface WeiboService {

    /**
     * get authorize url
     * @return url
     */
    String authorize();

    /**
     * get access token
     *
     * @param code code
     * @return SocialUser
     */
    SocialUser weiboAuth(@NonNull String code);

    /**
     * Obtain user information according to user ID
     *
     * @param uid         userId
     * @param accessToken accessToken
     * @return UserInfo
     */
    SinaUserInfo getUserInfo(String accessToken, String uid);

    /**
     * Obtain user information according to user ID
     *
     * @param screenName  screenName
     * @param uid         userId
     * @param accessToken accessToken
     * @return UserInfo
     */
    SinaUserInfo getUserInfo(String accessToken, String uid, String screenName);
}
